import request from "@/utils/request";
//更新或添加用户
export function addOrUpdateUser(user) {
    return request({
        url: "/user",
        method: "post",
        data: user
    });
}
//根据用户姓名获取用户
export function getUserByName(name) {
    return request({
        url: "/user/username/" + name,
        method: "get",
    });
}
//根据id删除用户
export function deleteUser(id) {
    return request({
        url: "/user/" + id,
        method: "delete",
    });
}
//根据姓名邮箱地址搜索用户
export function searchUser(Num, Size, Name,Email,Address) {
    return request({
        url: '/user/page',
        method: 'get',
        params: {
            pageNum: Num,
            pageSize: Size,
            username: Name,
            email: Email,
            address: Address,
        }
    });
}

//登录
export function login(loginfrom) {
    return request({
        url: '/user/login',
        method: 'post',
        data:loginfrom
    });
}
//注册
export function register(registerfrom) {
    return request({
        url: '/user/register',
        method: 'post',
        data:registerfrom
    });
}
//重置密码为123456
export function resetPassword(id) {
    return request({
        url: "/user/resetPassword",
        method: "post",
        params: {
            id: id
        }
    });
}
//将密码设置为987654321
// 写一个js的冒泡排序













